package com.xjust.controller;

import com.xjust.pojo.Result;
import com.xjust.service.DrugInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@CrossOrigin
@RestController
@RequestMapping("/drugInfos")
public class DrugInfoController {
    @Autowired
    DrugInfoService drugInfoService;
    //搜索药品
    @GetMapping("/searchDrug")
    public Result searchDrug(String drugName,String mnemonicCode){
       List<Map<String,Object>> list = drugInfoService.searchDrug(drugName,mnemonicCode);
        return Result.success(list);
    }
}
